package com.example.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.bean.History;
import com.example.service.HistoryService;
import com.example.mapper.HistoryMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author wjf
* @description 针对表【history】的数据库操作Service实现
* @createDate 2022-10-15 15:22:42
*/
@Service
public class HistoryServiceImpl extends ServiceImpl<HistoryMapper, History> implements HistoryService{

    @Resource
    private HistoryMapper historyMapper;

    @Override
    public IPage<History> findPage(IPage<History> page, Integer id, String bookName, String userName) {
        if (id!=null){  //学生
            IPage<History> historyIPage =  historyMapper.findPage(page,id,bookName,userName);
            return historyIPage;
        }
        if (id==null){  //管理员
            IPage<History> historyIPage =  historyMapper.findPage2(page,id,bookName,userName);
            return historyIPage;
        }
        return null;
    }
}




